<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="后端,PHP,">










<meta name="description" content="安装php7环境1、安装必要软件1234$ yum install libxml2 libxml2-devel curl curl-devel libpng-devel libjpeg-devel pcre-devel  autoconf #安装编译器gcc$ yum install gcc*">
<meta name="keywords" content="后端,PHP">
<meta property="og:type" content="article">
<meta property="og:title" content="centOS编译安装php7">
<meta property="og:url" content="https://zhuyunlong2018.gitee.io/2019/05/09/centOS编译安装php7/index.html">
<meta property="og:site_name" content="边泉小栈">
<meta property="og:description" content="安装php7环境1、安装必要软件1234$ yum install libxml2 libxml2-devel curl curl-devel libpng-devel libjpeg-devel pcre-devel  autoconf #安装编译器gcc$ yum install gcc*">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2020-05-06T01:05:51.586Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="centOS编译安装php7">
<meta name="twitter:description" content="安装php7环境1、安装必要软件1234$ yum install libxml2 libxml2-devel curl curl-devel libpng-devel libjpeg-devel pcre-devel  autoconf #安装编译器gcc$ yum install gcc*">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://zhuyunlong2018.gitee.io/2019/05/09/centOS编译安装php7/">





  <title>centOS编译安装php7 | 边泉小栈</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">边泉小栈</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">边泉it技术博客</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            Archives
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            Search
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="Searching..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://zhuyunlong2018.gitee.io/2019/05/09/centOS编译安装php7/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="ZhuYunlong">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.jpeg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="边泉小栈">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">centOS编译安装php7</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2019-05-09T14:23:40+08:00">
                2019-05-09
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/环境/" itemprop="url" rel="index">
                    <span itemprop="name">环境</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          
          
            <span class="post-meta-divider">|</span>
            <span id="busuanzi_value_page_pv"></span>次阅读
          
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h4 id="安装php7环境"><a href="#安装php7环境" class="headerlink" title="安装php7环境"></a>安装php7环境</h4><h6 id="1、安装必要软件"><a href="#1、安装必要软件" class="headerlink" title="1、安装必要软件"></a>1、安装必要软件</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ yum install libxml2 libxml2-devel curl curl-devel libpng-devel libjpeg-devel pcre-devel  autoconf </span><br><span class="line"></span><br><span class="line"><span class="comment">#安装编译器gcc</span></span><br><span class="line">$ yum install gcc*</span><br></pre></td></tr></table></figure>
  <a id="more"></a>
<h6 id="2、下载php7源码"><a href="#2、下载php7源码" class="headerlink" title="2、下载php7源码"></a>2、下载php7源码</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#如果没有wget命令(yum install -y  wget)</span></span><br><span class="line">$ wget  http://php.net/get/php-7.3.0.tar.gz/from/a/mirror</span><br><span class="line"><span class="comment"># 下载下来文件名可能就是mirror，可以重命名为php-7.3.0</span></span><br><span class="line">$ cp mirror php-7.3.0.tar.gz</span><br></pre></td></tr></table></figure>
<h6 id="3、解压安装"><a href="#3、解压安装" class="headerlink" title="3、解压安装"></a>3、解压安装</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#解压</span></span><br><span class="line">$ tar -zxvf php-7.3.0.tar.gz </span><br><span class="line"></span><br><span class="line"><span class="comment">#进入文件夹</span></span><br><span class="line">$ <span class="built_in">cd</span> php-7.3.0</span><br><span class="line"></span><br><span class="line">$ ./configure --prefix=/usr/<span class="built_in">local</span>/php7  --with-gd --with-iconv --with-mcrypt  --with-pdo-mysql=shared,mysqlnd --with-zlib --<span class="built_in">enable</span>-xml --<span class="built_in">enable</span>-mbstring --<span class="built_in">enable</span>-pcntl --with-curl </span><br><span class="line"></span><br><span class="line">$ make</span><br><span class="line"></span><br><span class="line">$ make install</span><br></pre></td></tr></table></figure>
<h6 id="4、配置环境变量"><a href="#4、配置环境变量" class="headerlink" title="4、配置环境变量"></a>4、配置环境变量</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#编辑配置文件</span></span><br><span class="line">$ vim /etc/profile</span><br><span class="line"></span><br><span class="line"><span class="comment">#在文件中添加如下一行</span></span><br><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$PATH</span>:/usr/<span class="built_in">local</span>/php7/bin</span><br><span class="line"></span><br><span class="line"><span class="comment">#重新加载资源</span></span><br><span class="line">$ <span class="built_in">source</span> /etc/profile</span><br><span class="line"></span><br><span class="line"><span class="comment"># 查看系统环境变量，可以看见刚才添加的已经在其中</span></span><br><span class="line">$ <span class="built_in">echo</span> <span class="variable">$PATH</span></span><br><span class="line">/usr/<span class="built_in">local</span>/sbin:/usr/<span class="built_in">local</span>/bin:/usr/sbin:/usr/bin:/usr/<span class="built_in">local</span>/php7/bin:/root/bin</span><br><span class="line"></span><br><span class="line"><span class="comment">#把php源码的php.ini.development  复制到 /usr/local/php7/lib/php.ini 里面</span></span><br><span class="line">$ cp /root/php-7.3.0/php.ini-development /usr/<span class="built_in">local</span>/php7/lib/php.ini</span><br></pre></td></tr></table></figure>
<h4 id="安装OpenSSL扩展"><a href="#安装OpenSSL扩展" class="headerlink" title="安装OpenSSL扩展"></a>安装OpenSSL扩展</h4><h6 id="1、php的扩展放在php源码包的ext文件夹中，"><a href="#1、php的扩展放在php源码包的ext文件夹中，" class="headerlink" title="1、php的扩展放在php源码包的ext文件夹中，"></a>1、php的扩展放在php源码包的ext文件夹中，</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> php-7.3.0/ext/openssl</span><br></pre></td></tr></table></figure>
<h6 id="2、编译安装"><a href="#2、编译安装" class="headerlink" title="2、编译安装"></a>2、编译安装</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="comment"># $ which phpize 找到phpize应用位置</span></span><br><span class="line">/usr/<span class="built_in">local</span>/php7/bin/phpize</span><br><span class="line"><span class="comment"># 然后执行</span></span><br><span class="line">$ /usr/<span class="built_in">local</span>/php7/bin/phpize</span><br><span class="line"><span class="comment"># 执行后，发现错误 无法找到config.m4 ，config0.m4就是config.m4。直接重命名</span></span><br><span class="line">$ cp config0.m4 config.m4</span><br><span class="line"><span class="comment"># 重新执行phpize</span></span><br><span class="line">$ /usr/<span class="built_in">local</span>/php7/bin/phpize</span><br><span class="line"><span class="comment"># $ which php-config 找到php-config应用位置</span></span><br><span class="line">/usr/<span class="built_in">local</span>/php7/bin/php-config</span><br><span class="line"><span class="comment"># 然后执行</span></span><br><span class="line">$ ./configure --with-openssl --with-php-config=/usr/<span class="built_in">local</span>/php7/bin/php-config</span><br><span class="line"><span class="comment">#如果上述出现错误：configure: error: Cannot find OpenSSL's &lt;evp.h&gt; 解决是安装下面命令</span></span><br><span class="line">$ yum install openssl openssl-devel </span><br><span class="line"></span><br><span class="line">$ make</span><br><span class="line">$ make <span class="built_in">test</span></span><br><span class="line">$ sudo make install</span><br><span class="line"></span><br><span class="line"><span class="comment">#安装完成后，会返回一个.so文件（openssl.so）的目录。在此目录下把openssl.so 文件拷贝到你在php.ini 中指定的 extension_dir 下（在php.ini文件中查找：extension_dir =），我这里的目录即是安装后自动生成so位置的目录，所以不用移动</span></span><br><span class="line">Installing shared extensions:     /usr/<span class="built_in">local</span>/php7/lib/php/extensions/no-debug-non-zts-20180731/</span><br></pre></td></tr></table></figure>
<h6 id="3、修改配置文件"><a href="#3、修改配置文件" class="headerlink" title="3、修改配置文件"></a>3、修改配置文件</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$ vim /usr/<span class="built_in">local</span>/php7/lib/php.ini</span><br><span class="line"></span><br><span class="line"><span class="comment"># 编辑php.ini文件，将；extension=openssl的分号去掉</span></span><br><span class="line">$ extension=openssl</span><br><span class="line"></span><br><span class="line"><span class="comment">#保存文件后，可以查看是否安装成功</span></span><br><span class="line">$ php -m</span><br></pre></td></tr></table></figure>
<h4 id="安装redis扩展"><a href="#安装redis扩展" class="headerlink" title="安装redis扩展"></a>安装redis扩展</h4><h6 id="1、下载"><a href="#1、下载" class="headerlink" title="1、下载"></a>1、下载</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ wget https://github.com/edtechd/phpredis/archive/php7.zip</span><br></pre></td></tr></table></figure>
<h6 id="2、解压"><a href="#2、解压" class="headerlink" title="2、解压"></a>2、解压</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ unzip php7.zip</span><br></pre></td></tr></table></figure>
<h6 id="3、-解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展"><a href="#3、-解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展" class="headerlink" title="3、 解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展"></a>3、 解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> phpredis-php7</span><br><span class="line">$ phpize</span><br></pre></td></tr></table></figure>
<h6 id="4、查找php-config路径"><a href="#4、查找php-config路径" class="headerlink" title="4、查找php-config路径"></a>4、查找php-config路径</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ find / -name php-config</span><br></pre></td></tr></table></figure>
<h6 id="5、配置环境"><a href="#5、配置环境" class="headerlink" title="5、配置环境"></a>5、配置环境</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ ./configure --with-php-config=/usr/<span class="built_in">local</span>/php7/bin/php-config</span><br></pre></td></tr></table></figure>
<h6 id="6、编译安装"><a href="#6、编译安装" class="headerlink" title="6、编译安装"></a>6、编译安装</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ make &amp;&amp; make install</span><br></pre></td></tr></table></figure>
<h4 id="安装swoole扩展"><a href="#安装swoole扩展" class="headerlink" title="安装swoole扩展"></a>安装swoole扩展</h4><h6 id="1、下载-1"><a href="#1、下载-1" class="headerlink" title="1、下载"></a>1、下载</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">$ git <span class="built_in">clone</span>  https://gitee.com/swoole/swoole.git</span><br><span class="line"></span><br><span class="line"><span class="comment">#或者直接用wget</span></span><br><span class="line">$ wget https://pecl.php.net/get/swoole-4.3.3.tgz</span><br><span class="line"></span><br><span class="line"><span class="comment">#解压</span></span><br><span class="line">$ tar zxvf  swoole-4.3.3.tgz</span><br><span class="line"></span><br><span class="line"><span class="comment">#进入文件夹</span></span><br><span class="line"><span class="built_in">cd</span> swoole-4.3.3</span><br></pre></td></tr></table></figure>
<h6 id="2、编译安装-1"><a href="#2、编译安装-1" class="headerlink" title="2、编译安装"></a>2、编译安装</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#ubuntu 没有安装phpize可执行命令：sudo apt-get install php-dev来安装phpize</span></span><br><span class="line">$ phpize</span><br><span class="line"></span><br><span class="line"><span class="comment">#配置</span></span><br><span class="line">$ ./configure</span><br><span class="line"></span><br><span class="line"><span class="comment">#编译</span></span><br><span class="line">$ make </span><br><span class="line"></span><br><span class="line"><span class="comment">#安装</span></span><br><span class="line">$ sudo make install</span><br></pre></td></tr></table></figure>
<h6 id="3、修改php-ini配置文件"><a href="#3、修改php-ini配置文件" class="headerlink" title="3、修改php.ini配置文件"></a>3、修改php.ini配置文件</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#进入php的配置文件中</span></span><br><span class="line">$ vim php.ini</span><br><span class="line"></span><br><span class="line"><span class="comment">#给php.ini中添加扩展</span></span><br><span class="line">extension=swoole</span><br><span class="line"></span><br><span class="line"><span class="comment">#查看是否安装成功</span></span><br><span class="line">$ php -m</span><br></pre></td></tr></table></figure>
<h4 id="安装composer"><a href="#安装composer" class="headerlink" title="安装composer"></a>安装composer</h4><h6 id="1、下载-2"><a href="#1、下载-2" class="headerlink" title="1、下载"></a>1、下载</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ curl -sS https://getcomposer.org/installer | php</span><br></pre></td></tr></table></figure>
<h6 id="2、移动文件"><a href="#2、移动文件" class="headerlink" title="2、移动文件"></a>2、移动文件</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ mv composer.phar /usr/<span class="built_in">local</span>/bin/composer</span><br></pre></td></tr></table></figure>
<h6 id="3、使用镜像"><a href="#3、使用镜像" class="headerlink" title="3、使用镜像"></a>3、使用镜像</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ composer config -g repo.packagist composer https://packagist.phpcomposer.com</span><br></pre></td></tr></table></figure>
<h6 id="4、或者直接使用php安装"><a href="#4、或者直接使用php安装" class="headerlink" title="4、或者直接使用php安装"></a>4、或者直接使用php安装</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#下载</span></span><br><span class="line">$ php -r <span class="string">"copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#执行安装</span></span><br><span class="line">$ php composer-setup.php</span><br><span class="line"></span><br><span class="line"><span class="comment">#删除安装脚本</span></span><br><span class="line">$ php -r <span class="string">"unlink('composer-setup.php');"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#全局安装</span></span><br><span class="line">$ sudo mv composer.phar /usr/<span class="built_in">local</span>/bin/composer</span><br></pre></td></tr></table></figure>
<h6 id="5、镜像用法"><a href="#5、镜像用法" class="headerlink" title="5、镜像用法"></a>5、镜像用法</h6><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 修改 composer 的全局配置文件（推荐方式）</span></span><br><span class="line">$ composer config -g repo.packagist composer https://packagist.phpcomposer.com</span><br><span class="line"></span><br><span class="line"><span class="comment"># 修改当前项目的 composer.json 配置文件</span></span><br><span class="line">$ composer config repo.packagist composer https://packagist.phpcomposer.com</span><br></pre></td></tr></table></figure>
<h6 id="6、出现Do-not-run-Composer-as-root-super-user-See-https-getcomposer-org-root-for-detail错误"><a href="#6、出现Do-not-run-Composer-as-root-super-user-See-https-getcomposer-org-root-for-detail错误" class="headerlink" title="6、出现Do not run Composer as root/super user! See https://getcomposer.org/root for detail错误"></a>6、出现Do not run Composer as root/super user! See <a href="https://getcomposer.org/root" target="_blank" rel="noopener">https://getcomposer.org/root</a> for detail错误</h6><p>root用户无法使用composer，需要切换到非root用户</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#切换到自己的用户</span></span><br><span class="line">$ su zhu</span><br><span class="line"></span><br><span class="line">$ composer</span><br></pre></td></tr></table></figure>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/后端/" rel="tag"># 后端</a>
          
            <a href="/tags/PHP/" rel="tag"># PHP</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/04/30/php框架通过命名空间实现自动加载类/" rel="next" title="php框架通过命名空间实现自动加载类">
                <i class="fa fa-chevron-left"></i> php框架通过命名空间实现自动加载类
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/08/07/php日志封装类/" rel="prev" title="php日志封装类">
                php日志封装类 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div id="gitalk-container"></div>

  




        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/avatar.jpeg" alt="ZhuYunlong">
            
              <p class="site-author-name" itemprop="name">ZhuYunlong</p>
              <p class="site-description motion-element" itemprop="description">记录个人在开发过程中遇到的一些问题</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">27</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">categories</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">9</span>
                  <span class="site-state-item-name">tags</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#安装php7环境"><span class="nav-number">1.</span> <span class="nav-text">安装php7环境</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#1、安装必要软件"><span class="nav-number">1.0.1.</span> <span class="nav-text">1、安装必要软件</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#2、下载php7源码"><span class="nav-number">1.0.2.</span> <span class="nav-text">2、下载php7源码</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#3、解压安装"><span class="nav-number">1.0.3.</span> <span class="nav-text">3、解压安装</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#4、配置环境变量"><span class="nav-number">1.0.4.</span> <span class="nav-text">4、配置环境变量</span></a></li></ol></li></ol><li class="nav-item nav-level-4"><a class="nav-link" href="#安装OpenSSL扩展"><span class="nav-number">2.</span> <span class="nav-text">安装OpenSSL扩展</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#1、php的扩展放在php源码包的ext文件夹中，"><span class="nav-number">2.0.1.</span> <span class="nav-text">1、php的扩展放在php源码包的ext文件夹中，</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#2、编译安装"><span class="nav-number">2.0.2.</span> <span class="nav-text">2、编译安装</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#3、修改配置文件"><span class="nav-number">2.0.3.</span> <span class="nav-text">3、修改配置文件</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装redis扩展"><span class="nav-number">3.</span> <span class="nav-text">安装redis扩展</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#1、下载"><span class="nav-number">3.0.1.</span> <span class="nav-text">1、下载</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#2、解压"><span class="nav-number">3.0.2.</span> <span class="nav-text">2、解压</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#3、-解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展"><span class="nav-number">3.0.3.</span> <span class="nav-text">3、 解压目录为pphpredis-php7，进入该文件夹，开始编译php扩展</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#4、查找php-config路径"><span class="nav-number">3.0.4.</span> <span class="nav-text">4、查找php-config路径</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5、配置环境"><span class="nav-number">3.0.5.</span> <span class="nav-text">5、配置环境</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#6、编译安装"><span class="nav-number">3.0.6.</span> <span class="nav-text">6、编译安装</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装swoole扩展"><span class="nav-number">4.</span> <span class="nav-text">安装swoole扩展</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#1、下载-1"><span class="nav-number">4.0.1.</span> <span class="nav-text">1、下载</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#2、编译安装-1"><span class="nav-number">4.0.2.</span> <span class="nav-text">2、编译安装</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#3、修改php-ini配置文件"><span class="nav-number">4.0.3.</span> <span class="nav-text">3、修改php.ini配置文件</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装composer"><span class="nav-number">5.</span> <span class="nav-text">安装composer</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#1、下载-2"><span class="nav-number">5.0.1.</span> <span class="nav-text">1、下载</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#2、移动文件"><span class="nav-number">5.0.2.</span> <span class="nav-text">2、移动文件</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#3、使用镜像"><span class="nav-number">5.0.3.</span> <span class="nav-text">3、使用镜像</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#4、或者直接使用php安装"><span class="nav-number">5.0.4.</span> <span class="nav-text">4、或者直接使用php安装</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5、镜像用法"><span class="nav-number">5.0.5.</span> <span class="nav-text">5、镜像用法</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#6、出现Do-not-run-Composer-as-root-super-user-See-https-getcomposer-org-root-for-detail错误"><span class="nav-number">5.0.6.</span> <span class="nav-text">6、出现Do not run Composer as root/super user! See https://getcomposer.org/root for detail错误</span></a></li></ol></li></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">ZhuYunlong</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>

<div>
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  <span id="busuanzi_container_site_pv" style="display:none">
      本站总访问量 <span id="busuanzi_value_site_pv"></span> 次
      <span class="post-meta-divider">|</span>
  </span>
  <span id="busuanzi_container_site_uv" style="display:none">
      有<span id="busuanzi_value_site_uv"></span>人看过我的博客啦
  </span>
</div>


        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
  <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
  <script src="/js/src/md5.min.js"></script>
   <script type="text/javascript">
        var gitalk = new Gitalk({
          clientID: '',
          clientSecret: '',
          repo: 'blog-comment',
          owner: 'zhuyunlong2018',
          admin: ['zhuyunlong2018'],
            id: md5(location.pathname),
          distractionFreeMode: 'true'
        })
        gitalk.render('gitalk-container')           
       </script>


  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

</body>
</html>
